Skip to content

Reading settings no longer overwrites Modified by/at - #248

Merged
kslysz merged 1 commit into
masterfrom
fix/jsonb-dirty-updates
Nov 17, 2026
Merged

kslysz merged 1 commit into
masterfrom
fix/jsonb-dirty-updates

Conversation

@kslysz

@kslysz kslysz commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Bug (3.15.1 and earlier): just opening Settings → Columns / Enums / Filters saved the rows again — modified_by became the user who looked, modified_at the time of the read. Columns: every row; enums: those with icons; filters: all.

Cause: the services are @Transactional (read-write) at class level. On commit Hibernate compares each jsonb value with its snapshot using equals; IconDto, DataColumnsConfigDto, DataFilterConfigDto and TaskConfigDto had none (identity), so the entities were always dirty → UPDATE → auditing set modified by/at.

Fix: @EqualsAndHashCode on these four DTOs (DataEnumItemDto and DataClassItemDto already had it). Real changes are still detected (fields compared by value).

Checked against the compose PostgreSQL (project Acme Shop, demo-admin), max(modified_at) per table before/after GET /api/columns|enums|filters|tasks|classes|buckets|views:

  • 3.15.1 (compose): columns, enums, filters → set to the time of the read
  • this branch (bootRun): unchanged

./gradlew test green. Existing wrong values stay as they are (no cleanup).

…figuration) no longer saves them again: the jsonb DTOs without equals (IconDto, DataColumnsConfigDto, DataFilterConfigDto, TaskConfigDto) made Hibernate see them as changed in every read-write transaction, so Modified by/at showed the last reader
@kslysz
kslysz merged commit f79040a into master Nov 17, 2026
2 checks passed
@kslysz
kslysz deleted the fix/jsonb-dirty-updates branch November 17, 2026 20:05
@kslysz kslysz mentioned this pull request Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant